# import threadpool
from selenium import webdriver
from PIL import Image
import tesserocr
print("123")
image=Image.open('code4.jpg')
image=image.convert('L')#将图片转化为灰度图像
threshold=127#指定二值化阈值，要在原图转化为灰度图像后使用
table=[]
for i in range(256):
    if i<threshold:
        table.append(0)
    else:
        table.append(1)
image=image.point(table,'1')
result=tesserocr.image_to_text(image)


# result=tesserocr.image_to_text(image)
print(result)
print("456")